<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="../static/css/bootstrap.css" >
<!--    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awebootstrap.csssome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">-->
    <link rel="stylesheet" href="../static/css/style-login.css">
    <title>我执欢迎您</title>
    <script src="../static/js/jquery-3.6.0.js"></script>
    <script>
        function login(){
                var name = $("input[name='name']").val();
                var password = $("input[name='password']").val();
                $.ajax({
                    type: 'post',
                    url: "login",
                    data: {"name": name, "password": password},
                    success: function (r){
                        if (r.msg == "success"){
                            alert(r.name + ",  欢迎您访问我执")
                            location.href = "main";
                        }
                        else {
                            alert("登录失败，用户名或密码错误");
                            location.href = "index";
                        }
                    }
                })
        }

    </script>
</head>


<body >
    <div class="container-fluid card1">
        <div class="card text-center " >
            <div class="card-body">
                    <div>
                        <img src="../static/img/wozhi.jpg"  width="72" height="72" >

                    </div>
                    <h1 class="h3 mb-3 font-weight-normal" >我执欢迎您</h1>

                    <input type="text" name="name"  class="form-control" placeholder="默认用户名zhumengquan"  autofocus="">

                    <input type="password" name="password" class="form-control" placeholder="默认密码hiwozhi"  >

    <!--                <button id="sign-btn" type="button" class="btn  btn-dark btn-block "  >-->
    <!--                    <a class="text-light" >注册</a>-->
    <!--                </button>-->
                    <button id="login-btn" onclick="login()" class="btn  btn-dark btn-block "  >
                        <a class="text-light" >登陆</a>
                    </button>
            </div>
        </div>
    </div>
</body>
</html>